<?php session_start();
//  Developed by Roshan Bhattarai 
//  Visit http://roshanbh.com.np for this script and more.
//  This notice MUST stay intact for legal use

// if session is not set redirect the user
if(empty($_SESSION['u_name']))
	header("Location:index.php");	

//if logout then destroy the session and redirect the user
if(isset($_GET['logout']))
{
	session_destroy();
	header("Location:index.php?logout=true");
}	
?>
<?php
$path = "http://".$_SERVER["HTTP_HOST"]."/gibbons";
?>
<?php
include 'includes/header.php';
?>
<table cellpadding="0" cellspacing="0" width="100%" border="0" >
<tr>
<td colspan="2">
<?php
$str = "<a href='home.php?logout' style='text-align:right;'><b>Logout<b></a>";
echo "<div align='right'>Welcome ".$_SESSION['name'].", ".$str."</div>";
?>
</td>
</tr>
<tr>
<td width="15%" valign="top">
<?php
include 'includes/menu.php';
?>
</td>
<td valign="top">
<div id="tabs">
<h2><font color="#66FF00"><center>Welcome to your contact page</center></font></h2>
<table border="0" cellpadding="0" cellspacing="0" width="900px">
			<tr style="background-color: #615B5B;color:#FFF;">
			<td width="80" align="center" height="30px;">
				<span style="color: #FFF;text-decoration: none;font-weight:normal;cursor: pointer;"><center>REQUEST</center></span>
			</td>
			<td width="80" align="left">
				<span style="color: #FFF;text-decoration: none;font-weight:normal;cursor: pointer;"><center>NAME</center></span>
			</td>
			<td width="80" align="left">
				<span style="color: #FFF;text-decoration: none;font-weight:normal;cursor: pointer;"><center>EMAIL</center></span>
			</td>
			<td width="80" align="left">
				<span style="color: #FFF;text-decoration: none;font-weight:normal;cursor: pointer;"><center>ADDRESS</center></span>
			</td>
			<td width="80" align="left">
				<span style="color: #FFF;text-decoration: none;font-weight:normal;cursor: pointer;"><center>CITY</center></span>
			</td>
			<td width="80" align="left">
				<span style="color: #FFF;text-decoration: none;font-weight:normal;cursor: pointer;"><center>COUNTRY</center></span>
			</td>
			<td width="80" align="left">
				<span style="color: #FFF;text-decoration: none;font-weight:normal;cursor: pointer;"><center>PROVINCE</center></span>
			
			</td>
			<td width="80" align="left">
				<span style="color: #FFF;text-decoration: none;font-weight:normal;cursor: pointer;"><center>POSTALCODE</center></span>
			</td>
			<td width="80" align="left">
				<span style="color: #FFF;text-decoration: none;font-weight:normal;cursor: pointer;"><center>PHONE</center></span>
			</td>
			<td width="80" align="left">
				<span style="color: #FFF;text-decoration: none;font-weight:normal;cursor: pointer;"><center>MESSAGE</center></span>
			</td>
			</tr>
				<?php
				$sql="SELECT * FROM tbl_contact_request";
				$run=mysql_query($sql);
				$icount=1;
				while($arr=mysql_fetch_array($run))
				{
					if(($icount%2)==0)
					{
						$style="style='background-color: #0B6E96;color: #FFF;font-size:12px;align:center'";
					}
					else
					{
						$style="style='background-color: #4F97B3;color: #FFF;font-size:12px;align:center'";
					}
				echo "<tr $style>";
																	echo "<td  width='80' align='center' height='50px'><span style='color: #FFF;text-decoration: none;font-weight: normal;'>".$arr["request"]."</span></td>";
																	echo "<td width='80'  align='center'><span style='color: #FFF;text-decoration: none;font-weight: normal;'>".$arr["name"]."</span></td>";
																		
																	echo "<td width='80'  align='center'><span style='color: #FFF;text-decoration: none;font-weight: normal;'>".$arr["email"]."</span></td>";
																	echo "<td width='80'  align='center'><span style='color: #FFF;text-decoration: none;font-weight: normal;'>".$arr["address"]."</span></td>";
																	echo "<td width='80'  align='center'><span style='color: #FFF;text-decoration: none;font-weight: normal;'>".$arr["city"]."</span></td>";
																	echo "<td width='80'  align='center'><span style='color: #FFF;text-decoration: none;font-weight: normal;'>".$arr["country"]."</span></td>";
																	echo "<td width='80'  align='center'><span style='color: #FFF;text-decoration: none;font-weight: normal;'>".$arr["province"]."</span></td>";
																	echo "<td width='80'  align='center'><span style='color: #FFF;text-decoration: none;font-weight: normal;'>".$arr["postalcode"]."</span></td>";
																	echo "<td width='80'  align='center'><span style='color: #FFF;text-decoration: none;font-weight: normal;'>".$arr["phone"]."</span></td>";
																	echo "<td width='80'  align='center'><span style='color: #FFF;text-decoration: none;font-weight: normal;'>".$arr["message"]."</span></td>";
																	
																	echo "</tr>";
																	
																	$icount++;
																}
															?>
																</table>
																</div>
																</td></tr>
																</table>
<?php
include 'includes/footer.php';
?>